package com.ming.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 定向交换机配置
 */
@Configuration
public class DirectConfiguration {
    @Bean
    public DirectExchange directExchange() {
        return ExchangeBuilder.directExchange("mt.direct2").durable(true).build();
    }

    @Bean
    public Queue directQueue3() {
        return QueueBuilder.durable("direct.queue3").build();
    }

    @Bean
    public Binding directBinding3_red() {
        return BindingBuilder.bind(directQueue3()).to(directExchange()).with("red");
    }

    @Bean
    public Binding directBinding3_ble() {
        return BindingBuilder.bind(directQueue3()).to(directExchange()).with("blue");
    }
}
